package comxyp.service.workbench.impl;
import comxyp.mapper.workbench.ActivityMapper;
import comxyp.pojo.workbench.Activity;
import comxyp.service.workbench.ActivityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;

@Service
public class ActivityServiceImpl implements ActivityService {
    @Autowired
    private ActivityMapper activityMapper;
    @Override
    public int saveActivity(Activity activity) {
        return activityMapper.insert(activity);
    }
    public List<Activity> findAll(){
        return activityMapper.selectActivity();
    }

    @Override
    public List<Activity> selectActivityByConditionForPage(Map<String, Object> map) {
        return activityMapper.selectActivityByConditionForPage(map);
    }

    @Override
    public int selectCountOfActivityByCondition(Map<String, Object> map) {
        return activityMapper.selectCountOfActivityByCondition(map);
    }

    @Override
    public int deleteById(String id) {
        return activityMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int deleteByIdAll(String[] id) {
        return activityMapper.deleteByIdAll(id);
    }

    @Override
    public List<Activity> findById(String[] id) {
        return activityMapper.findById(id);
    }

    @Override
    public int insertActivityByList(List<Activity> activityList) {
        return activityMapper.insertActivityByList(activityList);
    }

    @Override
    public int updateByPrimaryKeySelective(Activity activity) {
        return activityMapper.updateByPrimaryKeySelective(activity);
    }

    @Override
    public Activity selectById(String id) {
        return activityMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<Activity> selectByName(String name, String owner) {
        return activityMapper.selectByName(name,owner);
    }
}
